import React from 'react'
import { Route, Link, Redirect, Switch } from 'react-router-dom'
import TabBar from './components/TabBar'
import Category from './views/Category'
import Home from './views/Home'
import Mine from './views/Mine'

export default function App() {
  return (
    <div>
      App

      <ul>
        <li><Link to="/home">首页</Link></li>
        <li><Link to="/category">分类</Link></li>
        <li><Link to="/mine">我的</Link></li>
      </ul>

      <Switch>
        <Route path="/category" component={Category} />
        <Route path="/home">
          <Home />
          <TabBar />
        </Route>
        <Route path="/mine" render={() => (
          <>
            <Mine />
            <TabBar />
          </>
        )} />

        <Redirect to="/home" />
      </Switch>
    </div>
  )
}
